//package com.example.springbootlearn.security.config;
//
//import cn.hutool.json.JSONUtil;
//import org.springframework.security.core.Authentication;
//import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
//
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.util.HashMap;
//import java.util.Map;
//
//public class MyAuthenticationSuccessHandler implements AuthenticationSuccessHandler {
//
//
//    @Override
//    public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
//
//        Map<String, Object> map = new HashMap<>();
//        map.put("status", 200);
//        map.put("msg", "登录成功");
//        response.setContentType("application/json;charset=UTF-8");
//        response.getWriter().write(JSONUtil.toJsonStr(map));
//    }
//}
